<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui" template="../public/template.xhtml">


	<ui:define name="conteudoEsq">

		<h:form enctype="multipart/form-data">


			<p:panelGrid id="panel" style="text-align:center; width='500px'">
				<f:facet name="header">
					<p:row>
						<p:column colspan="2">
				    		Cadastro Item
				    	</p:column>
					</p:row>
				</f:facet>
				<p:row>
					<p:column>
						<h:outputLabel for="imagem" value="Imagem" />
					</p:column>
					<p:column style="text-align:left;padding:5px 10px 25px" colspan="2">
						<p:fileUpload  
							
							fileUploadListener="#{itemBean.uploadImagem}" mode="advanced"
							update="messages" sizeLimit="5000000"
							allowTypes="/(\.|\/)(gif|jpe?g|png)$/"
							style="width:230px;height:40px;font-size:10px;"
							
							customUI="true"/>
						<p:growl id="messages" showDetail="true" style="width:500px;" /><br/><br/>
		
					</p:column>
				</p:row>
				<p:row>
					<p:column>
						<h:outputLabel for="nomeItem" value="Nome"></h:outputLabel>
					</p:column>
					<p:column style="text-align:left;">
						<p:inputText id="nomeItem" required="true"
							value="#{itemBean.item.nomeItem}" label="Nome">
							<p:tooltip
								style="background-color:#63b8FF;border-radius:3px 3px 3px;color:#FFFFFF"
								for="nomeItem" value="Digite o nome do item" showEffect="fade"
								hideEffect="fade" />
						</p:inputText>
					</p:column>
				</p:row>
				<p:row>
					<p:column>
						<h:outputLabel for="descricao" value="Descricao"></h:outputLabel>
					</p:column>
					<p:column>
						<p:inputTextarea id="descricao" value="#{itemBean.item.descricao}"
							required="descricao" label="Descricao" style="width:300px;height:150px" >
							<p:tooltip
								style="background-color:#63b8FF;border-radius:3px 3px 3px;color:#FFFFFF"
								for="descricao" value="Digite a descricao do item"
								showEffect="fade" hideEffect="fade" />
						</p:inputTextarea>
					</p:column>
				</p:row>
				<p:row>

					<p:column colspan="2">
						<p:commandButton value="Inserir" action="#{itemBean.salvarItem()}"
							id="salvar" icon="ui-icon-disk" title="Salvar" style="width:100%;text-align:center; border:none!important;padding:0px!important;">
						</p:commandButton>
					</p:column>
				</p:row>
			</p:panelGrid>
			<p:growl autoUpdate="true" globalOnly="true" showDetail="true"/>
		</h:form>

	</ui:define>
	<ui:define name="conteudoDir">
		<p:graphicImage url="../img/lightbulb.png" style="display:block;"></p:graphicImage>
		<p> Ao cadastrar item, o administrador poderá escolhe-lo para cadastrar um edital</p>
		
	</ui:define>

</ui:composition>
